$(function() { 
 
    //alert('Ready to do your bidding!'); 
 
    $('p').click(function(){
        $(this).hide();
    });
  
    //    $('.hover').hover(function(){
    //        $('#myMooodal').modal({
    //            backdrop:false
    //        })
    //    });


    $('.icon-question-sign').click(function(){
        $(this).css('display','none');
        
        //AJAX
        //$(selector).load(URL,data,callback); 
        $("#helptext").css('display', 'inline');
        $("#helptext").load('data/help-this-EN.txt');
        
    });


    $("#getjson").click(function(){
        $.getJSON("data/demo_ajax_json.js",function(result){
            $.each(result, function(i, field){
                $("#json").append(field + " ");
            });
        });
    }); 
    
    $("button").click(function(){
        $.getJSON("demo_ajax_json.js",function(result){
            $.each(result, function(i, field){
                $("div").append(field + " ");
            });
        });
    }); 



    //-----------------------------------------------------------------------
    // 2) Send a http request with AJAX http://api.jquery.com/jQuery.ajax/
    //-----------------------------------------------------------------------
    $.ajax({                                      
        url: 'ajaxserver.php',                  //the script to call to get data          
        data: "",                        //you can insert url argumnets here to pass to api.php
        //for example "id=5&parent=6"
        dataType: 'json',                //data format      
        success: function(data)          //on recieve of reply
        {
            var id = data[0];              //get id
            var vname = data[1];           //get name
            //--------------------------------------------------------------------
            // 3) Update html content
            //--------------------------------------------------------------------
            $('#output').html("<b>id: </b>"+id+"<b> name: </b>"+vname); //Set output element html
        //recommend reading up on jquery selectors they are awesome 
        // http://api.jquery.com/category/selectors/
        } 
    });


});



